package com.jic.manager.mapper;

import java.lang.Long;
import java.util.List;

import com.jic.manager.entity.SysRoleUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 角色用户单关联表
 * @author : 
 * @email : 
 * @since : 2020-02-26 09:38:38
 * @version : v1.0.0
 */
@Mapper
public interface  SysRoleUserMapper {

    long insert(SysRoleUser sysRoleUser);

    long delete(Long id);

    long update(SysRoleUser sysRoleUser);

    SysRoleUser queryByPrimaryKey(Long id);

    List<SysRoleUser> query(SysRoleUser sysRoleUser);

    List<SysRoleUser> queryPage(@Param("startIndex") int startIndex, @Param("limit") int limit, @Param("sysRoleUser") SysRoleUser sysRoleUser);

    long queryPageCount(SysRoleUser sysRoleUser);

    @Delete("delete from sys_role_user where userid = #{userId}")
    void deleteByUserId(@Param("userId") Long id);

    SysRoleUser queryByUserIdRoleId(@Param("userId") Long userId, @Param("roleId") Long roleId);
}